package com.demo.extfunction;

import com.demo.annotation.Aspectj;
import com.demo.annotation.Around;
import com.demo.annotation.Component;
import com.demo.annotation.PointCut;
import com.demo.enhance.JoinPoint;

@Aspectj
@Component
public class PerformanceAnalysis {
    @PointCut("com.demo.entity.EchoImpl")
    public void pointCqqqut(){};
    @Around
    public Object around(JoinPoint joinPoint){
        Object ret = null;
        Long start = System.currentTimeMillis();
        System.out.println("-----开始执行--测试执行时间-----");
        try {
            ret= joinPoint.proceed();
        } catch (Throwable e) {
            e.printStackTrace();
        }
        Long end = System.currentTimeMillis();
        System.out.println("-----结束执行--结束执行时间-----");
        System.out.println("本次执行时间 = " + (end - start)+"ms");
        return ret;
    }
}
